package com.base.taglib;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;

import com.lazyzhao.string.StringUtils;
import com.base.service.UsersService;
import com.base.util.ServiceController;

public class RoleTag extends BodyTagSupport {

	private static final long serialVersionUID = 1L;
	
	private String roles = "";
	private String exclude = "";
	
	private UsersService rservice = ServiceController.s(UsersService.class);
	
	public int doAfterBody() throws JspException {
		HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
		String content = getBodyContent().getString();
		
		JspWriter out = getBodyContent().getEnclosingWriter();
		if(accordRule(request)){
			try {
				out.println(content);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return SKIP_PAGE;
	}
	
	public boolean accordRule(HttpServletRequest request){
		boolean flag = true;
		
		return flag;
	}

	public String getExclude() {
		return exclude;
	}

	public void setExclude(String exclude) {
		this.exclude = exclude;
	}

	public String getRoles() {
		return roles;
	}

	public void setRoles(String roles) {
		this.roles = roles;
	}
}
